// 容器内填充
const boxModelStyle = {
  paddingLeft: 0,
  paddingRight: 0,
  paddingTop: 0,
  paddingBottom: 0,
}


export const formComponents = [
  {
    type: 'sinput',
    name: "文本框",
    key: "",
    icon: 'icon-shurukuang',
    options: {
      defaultValue: null,
      dialogKey: '',
      hidden: false,
      clearable: false,
      disabled: false,
      readonly: false,
      label: 'label',
      fieldType: '',
      fieldLength: 0,
      placeholder: '',
      regularCheck: '',
      selfRuleCheck: '',
      triggerType: '',
      eventCode: '',
      sourceCode: '',
      sourceBingfield: ''
    },
    rules: [],
  },
  {
    type: 'stextarea',
    name: "文本域",
    key: "",
    icon: 'icon-shurukuang',
    options: {
      defaultValue: null,
      clearable: false,
      disabled: false,
      readonly: false,
      label: 'label',
      fieldType: '',
      fieldLength: 0,
      placeholder: '',
      regularCheck: '',
      selfRuleCheck: ''
    },
    rules: []
  },
  {
    type: 'sswitch',
    name: "开关",
    key: "",
    icon: 'icon-shurukuang',
    options: {
      defaultValue: '',
      disabled: false,
      label: 'label',
      closeValue: '0',
      openValue: '100'
    },
    rules: []
  },
  {
    type: 'srate',
    name: "评分",
    key: "",
    icon: 'icon-pingfen',
    options: {
      defaultValue: 0,
      label: 'label',
      disabled: false,
      allowHalf: false,
      maxscore: 5
    }
  },
  {
    type: 'sselect',
    name: "下拉单选",
    key: "",
    icon: 'icon-xialakuang',
    options: {
      defaultValue: '',
      label: 'label',
      placeholder: '请选择',
      eventCode: '',
      filterable: false,
      disabled: false,
      regularCheck: '',
      selfRuleCheck: '',
      options: [],
      sourceCode: ''
    },
    rules: []
  },
  {
    type: 'smultiple',
    name: "下拉多选",
    key: "",
    icon: 'icon-xialakuang',
    options: {
      defaultValue: [],
      label: 'label',
      placeholder: '请选择',
      filterable: false,
      disabled: false,
      regularCheck: '',
      selfRuleCheck: '',
      options: []
    },
    rules: []
  },
  {
    type: 'sdate',
    name: "日期控件",
    key: "",
    icon: 'icon-riqi',
    options: {
      defaultValue: '',
      clearable: false,
      disabled: false,
      readonly: false,
      label: 'label',
      placeholder: '',
      showType: 'yyyy-MM-dd',
      format: 'yyyy-MM-dd',
      regularCheck: '',
      selfRuleCheck: ''
    },
    rules: []
  },
  {
    type: 'stime',
    name: "时间控件",
    key: "",
    icon: 'icon-riqi',
    options: {
      defaultValue: '',
      clearable: false,
      disabled: false,
      readonly: false,
      label: 'label',
      placeholder: '选择时间',
      selectableRange: { selectableRange: '06:30:00 - 18:30:00' },
      showType: 'HH:mm:ss',
      format: 'HH:mm:ss',
      regularCheck: '',
      selfRuleCheck: '',
      sourceCode: '',
      sourceBingfield: ''
    },
    rules: []
  },
  {
    type: 'sradio',
    name: "单选框",
    key: "",
    className: '',
    icon: 'icon-riqi',
    options: {
      defaultValue: '',
      label: 'label',
      disabled: false,
      eventCode: '',
      sourceCode:'',
      options: [
        {
          label: '备选项一',
          value: 0
        }, {
          label: '备选项二',
          value: 1
        }
      ]
    }
  },
  {
    type: 'scheckbox',
    name: "多选框",
    key: "",
    className: '',
    icon: 'icon-riqi',
    options: {
      defaultValue: [],
      label: 'label',
      disabled: false,
      options: [
        {
          label: '备选项一',
          value: 0
        }, {
          label: '备选项二',
          value: 1
        }
      ]
    }
  },
  {
    type: 'stransfer',
    name: "穿梭框",
    key: "",
    className: '',
    icon: 'icon-riqi',
    options: {
      data: [
        {
          key: 'q',
          label: `备选项1`,
          disabled: false
        }, {
          key: 'x',
          label: `备选项2`,
          disabled: false
        }, {
          key: 'p',
          label: `备选项3`,
          disabled: false
        },
      ],
      defaultValue: [],
    }
  },
  {
    type: 'sinput_number',
    name: "计数器",
    key: "",
    icon: 'icon-m-jishuqi',
    options: {
      defaultValue: 0,
      label: 'label'
    }
  },
  {
    type: 'scascader',
    name: "级联选择",
    key: "",
    icon: 'icon-jilianxuanze',
    options: {
      defaultValue: [],
      label: 'label'
    }
  },
  {
    type: 'stree_select',
    name: "树形下拉",
    key: "",
    icon: 'icon-shuxingkongjian',
    options: {
      defaultValue: [],
      label: 'label'
    }
  },
  {
    type: 'sslider',
    name: "滑块",
    key: "",
    icon: 'icon-huakuai-',
    options: {
      defaultValue: 0,
      label: 'label'
    }
  },
  {
    type: 'sfileupload',
    name: "文件上传",
    key: "",
    icon: 'icon-yunshangchuan',
    options: {
      defaultValue: 0,
      label: 'label'
    }
  },
  {
    type: 'simagesupload',
    name: "图片上传",
    key: "",
    icon: 'icon-yunshangchuan',
    options: {
      defaultValue: 0,
      label: 'label'
    }
  },
  {
    type: 'stinymce',
    name: "富文本",
    key: "",
    icon: 'icon-1fuwenben',
    options: {
      defaultValue: '',
      label: '测试名称',
      options: {
        height: '300',
        languageType: 'zh_CN',
        menubar: 'file edit insert view format table tools',
        sourceCode: '',
        sourceBingfield: ''
      }
    }
  },
  {
    type: 'stable',
    name: "普通表格",
    key: "",
    icon: 'icon-biaoge',
    options: {
      iseditor: false,
      isSelection: false,
      defaultValue: '',
      fixedright: false,
      selectEventCode: '',
    },
    handles: [],
    columns: [],
    data: [],
    multipleSelection: []
  },
  {
    type: 'seditor_table',
    name: "编辑表格",
    key: "",
    icon: 'icon-biaoge',
    options: {
      iseditor: false,
      isSelection: false,
      defaultValue: '',
      fixedright: false,
      selectEventCode: '',
      isPaging: false,
    },
    paramsConfig: [],
    handles: [],
    columns: [],
    data: [],
    multipleSelection: []
  },
  {
    type: 'sbutton',
    name: "按钮",
    key: "",
    decree: '',
    sneakIntoName: '',
    icon: 'icon-anniu',
    options: {
      transform: {
        x: 0,
        y: 0
      },
      defaultValue: '',
      isConfirm: false,
      confirmOption: {
        title: '提示',
        content: '确认框......',
        type: 'success',
      },
      type: "primary",
      name: "按钮",
      triggerType: 'click',
      eventCode: '',
      isSubmit: false,
      dialogKey: ''
    }
  },

]

export const hiddenComponents = [
  {
    type: 'sdialog',
    name: "弹框",
    key: "",
    icon: 'icon-shurukuang',
    options: {
      defaultValue: '',
      formDataName: '',
      formData: null,
      triggerSourceKey: '',
      name: "弹框标题",
      dialogVisible: false,
      width: '80',
    },
    params: {},
    handles: [],
    list: [],
  }
]


export const showComponents = [
  {
    type: 'sfield',
    name: "文本",
    key: "",
    sneakIntoName: '',
    icon: 'icon-xialakuang',
    options: {
      defaultValue: '文本1',
      fontSize: 22,
      color: '',
      align: ''
    },
    boxModelStyle: { ...boxModelStyle },
  },
  {
    type: 'sdescriptions',
    name: "矩阵列表",
    key: "",
    sneakIntoName: '',
    icon: 'icon-xialakuang',
    options: {
      title: '标题',
      col:'3',
      direction:'horizontal', //vertical / horizontal
      colon:true,
      border:false,
      data:[
        {
          label:'用户名',
          value:'kooriookami',
          type:''
        },{
          label:'手机号',
          value:'18100000000',
          type:''
        },{
          label:'居住地',
          value:'苏州市',
          type:''
        },{
          label:'备注',
          value:'学校',
          type:''
        },{
          label:'联系地址',
          value:'江苏省苏州市',
          type:''
        }
      ]
    },

  },

]


export const layoutComponents = [
  {
    type: 'ssubmeter',
    name: "分表容器",
    key: "",
    icon: 'icon-xialakuang',
    options: {
      chineseName: "",
      creator: false,
      create_time: false,
      updater: false,
      update_time: false,
      deleted: false,
      disabled: false,
      status: false,
      ver: false
    },
    foreignKeys: [],
    columns: [],
  },
  {
    type: 'sblank',
    name: "空白容器",
    key: "",
    icon: 'icon-xialakuang',
    options: {
      className: '',
      hidden: false,
      backgroundColor: '',
      borderRadius: 0,
      marginTop: 0,
      marginRight: 0,
      marginBottom: 0,
      marginLeft: 0,
    },
    columns: [],
    boxModelStyle: { ...boxModelStyle },
  },
  {
    type: 'sordinary_panel',
    name: "普通面板",
    key: "",
    icon: 'icon-xialakuang',
    options: {},
    columns: [],
    hiddenColumns: [],
    boxModelStyle: { ...boxModelStyle },
  },
  {
    type: 'sfolded_panel',
    name: "折叠面板",
    key: "",
    icon: 'icon-xialakuang',
    options: {},
    columns: [],
    hiddenColumns: [],
    boxModelStyle: { ...boxModelStyle },
  },
  {
    type: 'sform',
    name: "表单区域",
    icon: 'icon-zu',
    key: '',
    sneakIntoName: '',
    config: {
      labelWidth: 80,
      labelPosition: 'right',
      size: 'small',
      title: '表单域标题',
    },
    boxModelStyle: { ...boxModelStyle },
    columns: [],
  },
  {
    type: 'slayout',
    name: "格栅布局",
    icon: 'icon-gezha',
    key: '',
    sneakIntoName: '',
    columns: [
      {
        span: 8,
        list: []
      },
      {
        span: 8,
        list: []
      },
      {
        span: 8,
        list: []
      }
    ],
    options: {
      gutter: 0,
      justify: 'start',
      align: 'top'
    },
    boxModelStyle: { ...boxModelStyle },
  },
  {
    type: 'scard',
    name: "卡片容器",
    icon: 'icon-kapian',
    key: '',
    sneakIntoName: '',
    container: [],
    handles: [],
    options: {
      title: "卡片标题"
    },
    boxModelStyle: { ...boxModelStyle },
  },
  {
    type: 'stabs',
    name: "标签容器",
    icon: 'icon-tag',
    key: '',
    sneakIntoName: '',
    columns: [
      {
        label: '标签页1',
        name: 'xxxxxxxx',
        list: []
      },
      {
        label: '标签页2',
        name: 'yyyyyyyy',
        list: []
      }
    ],
    options: {
      defaultValue: "xxxxxxxx"
    },
    boxModelStyle: { ...boxModelStyle },
  },
  {
    type: 'soperations_group',
    name: "操作组",
    key: "",
    icon: 'icon-xialakuang',
    options: {
      marginTop: 0,
      marginBottom: 0,
      align: '',
      gutter: 5
    },
    columns: [],
  },
]

export const chartComponents = [
  {
    type: 'scategory',
    name: "柱状图",
    key: "",
    sneakIntoName: '',
    icon: 'icon-tubiaobeifen5',
    size: {
      width: '100%',
      height: '370px'
    },
    options: {
      xAxis: {
        type: 'category',
        data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
      },
      yAxis: {
        type: 'value'
      },
      series: [{
        data: [120, 200, 150, 80, 70, 110, 130],
        type: 'bar',
        showBackground: true,
        backgroundStyle: {
          color: 'rgba(180, 180, 180, 0.2)'
        }
      }]
    },
  },
  {
    type: 'spie',
    name: "饼图",
    key: "",
    sneakIntoName: '',
    icon: 'icon-tubiao08',
    size: {
      width: '100%',
      height: '370px'
    },
    options: {
      tooltip: {
        trigger: 'item'
      },
      legend: {
        top: '5%',
        left: 'center'
      },
      series: [
        {
          name: '访问来源',
          type: 'pie',
          radius: ['40%', '70%'],
          avoidLabelOverlap: false,
          label: {
            show: false,
            position: 'center'
          },
          emphasis: {
            label: {
              show: true,
              fontSize: '40',
              fontWeight: 'bold'
            }
          },
          labelLine: {
            show: false
          },
          data: [
            { value: 1048, name: '搜索引擎' },
            { value: 735, name: '直接访问' },
            { value: 580, name: '邮件营销' },
            { value: 484, name: '联盟广告' },
            { value: 300, name: '视频广告' }
          ]
        }
      ]
    },
  }
]